#include "common.h"

Common::Common(QObject *parent) :
    QObject(parent)
{
}

QString Common::sizeToString(double bytes)
{
    if ( bytes > 1000000000)
        return QString::number(qRound(bytes/1099511627776))+" Gb";


    if ( bytes > 1000000)
        return QString::number(qRound(bytes/1048576))+" Mb";

    if ( bytes > 1000)
        return  QString::number(qRound(bytes/1024))+" Kb";



    return QString::number(qRound(bytes))+" b";



}
